﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using Enterprise.Management.Models;
using Enterprise.Management.Business;
using Enterprise.Management.Data;

namespace Enterprise.Management.Caches
{
    public class HtmlCache
    {
        public static DP_User GetUser()
        { 
            LoginBLL bll = new LoginBLL();
            bll.Load();

            UserBLL userbll = new UserBLL();
            return userbll.GetUser(bll.UserId);
        }

        public static List<DP_Category> GetCategories(DeptCategoryLevelType type)
        {
            CategoryBLL bll = new CategoryBLL();
            int? parent = null;

            switch (type)
            { 
                case DeptCategoryLevelType.LevelII:
                    parent = (int)DeptCategoryLevelType.LevelI;
                    break;
                case DeptCategoryLevelType.LevelIII:
                    parent = (int)DeptCategoryLevelType.LevelII;
                    break;
            }
            return bll.GetCategories(parent);
        }
    }
}